package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class ConnectionEvents implements ActionListener {

	ConnectionMenu connection;


	public ConnectionEvents(ConnectionMenu connection){
		this.connection=connection;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource().equals(connection.connectButton)){

			ConnectionThread thread = new ConnectionThread(connection);
			ExecutorService serviceExec = Executors.newCachedThreadPool();
			serviceExec.submit(thread);
			serviceExec.shutdown();
			connection.connectButton.setEnabled(false);


		}
	}

}
